package com.googlecode.jtoy.patterns.factory;

import static org.junit.Assert.*;

import org.junit.Test;

/**
 * @author shangxj
 * @date Jun 27, 2011 1:55:11 PM
 */
public class TestFactory {

	@Test
	public void testCreateCircle() {

		ShapeFactory factory = new ShapeFactoryImpl();
		Shape shape = factory.make(Circle.class);

		assertTrue(shape instanceof Circle);
		shape.draw();
	}

	@Test
	public void testCreateSquare() {

		ShapeFactory factory = new ShapeFactoryImpl();
		Shape shape = factory.make("com.googlecode.jtoy.patterns.factory.Square");

		assertTrue(shape instanceof Square);
		shape.draw();
	}

}
